{template 'common/header'}

<form class="table-top-search form-inline" id="search_table" method="GET" action="#">
<div class="btn-group" role="group" aria-label="...">
    <a class="btn btn-default" href="{php echo wurl('site/entry', array('et' => 2, 'eid' => $_GET['eid'], 'version_id'=>0))}" role="button">新增</a>
    <a class="btn btn-default" href="javascript:;" role="button" id="del">删除</a>
    <a class="btn btn-default" role="button">保存</a>
    <a href="javascript:;" type="checkbox" class="btn btn-default" onclick="checkall(this, '.check-all')" data-checked="0">全选</a>
    {php echo tpl_form_field_daterange('daterange')}
    <button class="btn btn-default">查询</button>
</div>
</form>

<form name="adform" action="{php echo aurl(7)}" id="form" method="POST">
    <table class="table table-striped">
        <thead>
            <tr>
                <td>#</td>
                <td>编号</td>
                <td>头像</td>
                <td>姓名</td>
                <td>电话</td>
                <td>新/老总</td>
                <td>排序</td>
                <td>操作</td>
            </tr>
        </thead>
        {loop $sql1 $item}
        <tbody>
            <tr>
                <td>
                    <input type="checkbox" name="checkname[]" class="check-all" value="{$item['uid']}">
                </td>
                <td>{$item['uid']}</td>
                <td>
                    <img src="{media $item['image']}" width="60" height="60">
                </td>
                <td>{$item['name']}</td>
                <td>{$item['phonenum']}</td>
                <td>{$item['b_name']}</td>
                <td>{$item['orde']}</td>
                <td>
                    {php $uid=$item['uid']}
                    <a type="submit" class="btn btn-default" href="{php echo wurl('site/entry',array('uid'=>$uid,'version_id'=>0,'et'=>5,'eid'=>1))}" role="button">修改</a>
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</form>
{$html}
<script>
    function checkall(_this, dom) {
        var isCheck = $(_this).attr('data-checked');
        if(isCheck == '0') {
            $(dom).prop('checked', true);
            $(_this).attr('data-checked', '1');
        } else {
            $(dom).prop('checked', false);
            $(_this).attr('data-checked', '0');
        }
    }

    $('#del').on('click', function() {
        $('#form').submit();
    })
</script>
{template 'common/footer'}